namespace hjc {
	export class Sprite extends Component {

		private $views: egret.DisplayObject[];
		private $alpha: number;
		private $visible: boolean;
		public get views(): egret.DisplayObject[] { return this.$views; }
		public set views(views: egret.DisplayObject[]) { this.$views = views; }
		public get alpha(): number { return this.alpha; }
		public set alpha(alpha: number) {
			this.$views.forEach(view => view.alpha = alpha);
			this.$alpha = alpha;
		}
		public get visible(): boolean { return this.visible; }
		public set visible(visible: boolean) {
			this.$views.forEach(view => view.visible = visible);
			this.$visible = visible;
		}
		public init(...views: egret.DisplayObject[]): void {
			this.$views = [];
			this.$alpha = 1;
			this.$visible = true;
			super.resetPfc();
			if (notEmptyArr(views)) this.$views.push(...views);
		}

		public add(...views: egret.DisplayObject[]): void {
			this.$views.push(...views);
		}

		public dispose(): void {
			this.$views.forEach(view => ui.remove(view));
		}
	}
}